<?php
namespace server;

use eqphp\db;

class job{

    static function push($operation, $param){
        if (!is_array($param)) {
            $param = [$param];
        }
        return db::post(table::JOB_QUEUE, [
            'operation' => $operation,
            'param' => serialize($param),
            'create_time' => date('Y-m-d H:i:s'),
        ]);
    }

    static function message($phone, $data, $template){
        return with('message')->take($data, $template)->send($phone);
    }

}